<template>
	<view class="ItroduceBox" @click="toInfo" :id="item.id">
		<view class="Item-Left">
			<image class="Introduce-Img" lazy-load :src="item.tcover"></image>
		</view>
		<view class="Item-right column">
			<view class="title row">
				<!-- <text>标题:</text> -->
				<view class="Title-Content">
					{{ item.ttitle }}
				</view>
			</view>
			<view class="content row">
				<!-- <text>内容:</text> -->
				<text class="Content-Info" v-html=" item.tcontent ">
					<!-- {{ item.tcontent }} -->
				</text>
			</view>
			<view class="time row">
				<!-- <text>发布时间:</text> -->
				<view class="Time-Info">
					{{ item.createTime | formatTime }}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import '@/common/css/Introduce-Item.scss'
	export default {
		data() {
			return {
				id: null
			};
		},
		props: {
			item: {
				type: Object,
				
			}
		},
		methods: {
			toInfo(event) {
				let id = event.currentTarget.id;
				uni.redirectTo({
					url: "/pages/Info/Info?id=" + id
				});
			}
		},
		filters: {
			formatTime(value) {
				const date = new Date(value);
				const year = date.getFullYear();
				const month = ('0' + (date.getMonth() + 1)).slice(-2);
				const day = ('0' + date.getDate()).slice(-2);
				const hours = ('0' + date.getHours()).slice(-2);
				const minutes = ('0' + date.getMinutes()).slice(-2);
				return `${year}-${month}-${day} ${hours}:${minutes}`;
			}
		}
	};
</script>

<style>

</style>